package org.seckill.dto;

import org.seckill.entity.SeckillSuccess;

/**
 * 封装秒杀后的结果
 * @author Dwutian
 *
 */
public class SeckillExecution {
	//秒杀产品id
	private long seckillid;
	//秒杀结果
	private int state;
	private String stateinfo;
	//秒杀订单
	private SeckillSuccess successSeckilled;
	
	
	public SeckillExecution(long seckillid, SeckillEnum seckill) {
		this.seckillid = seckillid;
		this.state = seckill.getState();
		this.stateinfo = seckill.getStateinfo();
	}
	public SeckillExecution(long seckillid, SeckillEnum seckillenum, SeckillSuccess successSeckilled) {
		this.seckillid = seckillid;
		this.state = seckillenum.getState();
		this.stateinfo = seckillenum.getStateinfo();
		this.successSeckilled = successSeckilled;
	}
	public long getSeckillid() {
		return seckillid;
	}
	public void setSeckillid(long seckillid) {
		this.seckillid = seckillid;
	}


	public int getState() {
		return state;
	}
	public void setState(int state) {
		this.state = state;
	}
	public String getStateinfo() {
		return stateinfo;
	}
	public void setStateinfo(String stateinfo) {
		this.stateinfo = stateinfo;
	}
	public SeckillSuccess getSuccessSeckilled() {
		return successSeckilled;
	}
	public void setSuccessSeckilled(SeckillSuccess successSeckilled) {
		this.successSeckilled = successSeckilled;
	}
	@Override
	public String toString() {
		return "SeckillExecution [seckillid=" + seckillid + ", state=" + state + ", stateinfo=" + stateinfo
				+ ", successSeckilled=" + successSeckilled + "]";
	}
	
	
}
